<?php
class Register extends Controller
{
	function Register ()
	{
		parent::Controller ();
		#$this->load->library('DX_Auth');
		$this->output->enable_profiler(TRUE);
		$this->load->library('Form_validation');
	}
	
	function check_username ($username = '')
	{
		if (strlen ($username) > 4)
		{
			if ($this->dx_auth->is_username_available ($username))
			{
				echo 'available';
			}
			else
			{
				echo 'taken';
			}
		}
		else
		{
			echo 'short';
		}
	}
	
	function check_email ($email = '')
	{
		$this->load->helper ('email');
		if (valid_email ($email))
		{
			if ($this->dx_auth->is_email_available ($email))
			{
				echo 'available';
			}
			else
			{
				echo 'taken';
			}
		}
		else
		{
			echo 'invalid';
		}
	}
	
	function index ()
	{
		// Do this later, i have to work.. in the rain. fml
	}
	
	function submit ()
	{
		// maybe get rid of this and just use register.
	}
}